import React, { Component } from 'react'

export default class Son extends Component {
    state = {
        userinfo: {
            name: '儿子',
            age: 8
        }
    }
    render() {
        return (
            <div>
                <p>子组件</p>

            </div>
        )
    };
    componentDidMount() {
        // console.log('this', this);
        // 调用父组件传递过来的方法
        // this.props.tosonFn(this.state.userinfo)
    };
    tofatherFn() {
        return this.state.userinfo
    }
}
